package com.gomoku.utils;

import com.gomoku.model.Board;
import com.gomoku.model.Move;

import java.util.ArrayList;
import java.util.List;

public class MCTNode {
    public Board state;
    public MCTNode parent;
    public List<MCTNode> children;
    public Move move;
    public int visits;
    public double wins;
    public int depth;

    public MCTNode(Board state, MCTNode parent, Move move) {
        this.state = state;
        this.parent = parent;
        this.move = move;
        this.children = new ArrayList<>();
        this.visits = 0;
        this.wins = 0;
        this.depth = (parent == null) ? 0 : parent.depth + 1;
    }

    public MCTNode(Board state, MCTNode parent, Move move, double wins, int visits) {
        this(state, parent, move);
        this.wins = wins;
        this.visits = visits;
    }
}
